<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ElectricPlatformOwner extends Model
{
    public $timestamps = false;
    protected $connection = 'mysql_center';
    protected $table = 'electric_platform_owner';


    public function platform_agent()
    {
        return $this->hasOne(ElectricPlatformAgent::class, "id", "fatherId");
    }
    public function payment_order()
    {
        return $this->hasMany(ElectricPaymentOrder::class, "user_id", "id")->where('status' , 2);
    }
    public function fee_log()
    {
        return $this->hasMany(ElectricFeeLog::class, "owner_id", "id")->where(['pay_type' => 4]);
    }
    public function community()
    {
        return $this->hasOne(ElectricCommunity::class, "id", "community");
    }

}
